<?php 
	class AddressModel extends Model{
		public $table = 'address';
		

		public $validate = array(
 		array('name','nonull','您的姓名布能为空',2,3),
 		array('cellphone','nonull','您的姓民能为空',2,3),
 		array('cellphone','maxlen:11','手机号码布正确',2,3),
 		array('detail','nonull','请填入手机号码',2,3),
 		);

 		
		/**
		 * [get_data 获得全部数据]
		 * @param  [type] $where [description]
		 * @return [type]        [description]
		 */
		public function get_data($where = NULL){
			return $this->where($where)->all();
		}
		
		/**
		 * [get_one_data 查找单条数据]
		 * @param  [type] $where [description]
		 * @return [type]        [description]
		 */
		public function get_one_data($where = NULL){
			return $this->where($where)->find();
		}
		
		/**
		 * [add_data 添加数据]
		 */
		public function add_data($data = null){
		$aid = $this->add($data);

			
		}
		/**
		 * [update_data 修改一条数据]
		 * @param  [type] $where [description]
		 * @return [type]        [description]
		 */
		public function update_data($where){
			$this->where($where)->save();
		}
		

		/**
		 * [update_data 删除数据]
		 * @param  [type] $where [description]
		 * @return [type]        [description]
		 */
		public function dal_data($where){
			$this->where($where)->delete();
		}

	}




 ?>